﻿/*==============================================================
 * MenuNavMapping.cs
 * Copyright (C) 2014 贵州惠众互联 Inc. All rights reserved.
 *==============================================================
 * Author:   罗应红
 * Date:     2014/02/28 16:07:05.
 * Version:  1.0
 * QQ:		 88962800
*==============================================================*/

using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using QDT.Core.Domain;

namespace QDT.Core.MSData.Mapping {
    public class MenuNavMapping:EntityTypeConfiguration<MenuNav> {
        public MenuNavMapping() {
            HasKey(o => o.ID);
            Property(o => o.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            HasMany(o => o.Child).WithOptional(o => o.Parent).HasForeignKey(o => o.ParentId);
            Property(o => o.IsEffect).HasColumnName("is_effect");
            Property(o => o.UModule).HasColumnName("u_module");
            Property(o => o.UAction).HasColumnName("u_action");
            Property(o => o.UId).HasColumnName("u_id");
            Property(o => o.UParam).HasColumnName("u_param");
            Property(o => o.IsShop).HasColumnName("is_shop");
            Property(o => o.AppIndex).HasColumnName("app_index");
            ToTable(DB.TPref("nav"));
        }
    }
}